﻿using System.Web.Mvc;
using Microsoft.Web.Mvc.ModelBinding;
using RouteCollectionExtensions = TSharp.Core.Mvc.XmlRouting.RouteRegisterExtensions;
using TSharp.Core.Osgi;
using TSharp.Core.Mvc.Web;
[assembly: RegAppEvent(typeof(TSharpAppStartMvcSettingEvent), Order = int.MinValue)]

namespace TSharp.Core.Mvc.Web
{
    /// <summary>
    ///     mvc app启动和停止事件
    /// </summary>
    /// <author>
    ///     tangjingbo
    /// </author>
    /// <remarks>
    ///     tangjingbo at 2009-8-4 13:38
    /// </remarks>
    public class TSharpAppStartMvcSettingEvent : IAppHandler
    {
        /// <summary>
        ///     web程序开始调用，等同于Application_Start()
        /// </summary>
        /// <param name="args">
        ///     The <see cref="TSharp.Core.AppEventArgs" /> instance containing the event data.
        /// </param>
        public void OnStart(AppEventArgs args)
        {
            DependencyResolver.SetResolver(new TSharpDependencyResolver());

            //ViewEngines.Engines.Clear();
            //ViewEngines.Engines.Insert(0, new TSharpThemesViewEngine());

            //ControllerBuilder.Current.SetControllerFactory(TSharpControllerFactory.Instance);
             //ModelBinderConfig.Initialize();
        }


        public void OnStop(AppEventArgs args)
        { 
        }
    }
}